package com.csweimei.rentmanagementtreasure.http.entity;

import com.csweimei.rentmanagementtreasure.utils.ValidateUtils;
import com.google.gson.annotations.SerializedName;

import java.util.List;

public class BrokerFollowupBean extends BaseResult{
    @SerializedName("data")
    private List<DataDTO> data;

    public List<DataDTO> getData() {
        return data;
    }

    public void setData(List<DataDTO> data) {
        this.data = data;
    }

    public static class DataDTO {
        @SerializedName("housingID")
        private int housingID;
        @SerializedName("housingImg")
        private String housingImg;
        @SerializedName("quarters")
        private String quarters;
        @SerializedName("roomname")
        private String roomname;
        @SerializedName("housingType")
        private String housingType;
        @SerializedName("totalArea")
        private String totalArea;
        @SerializedName("rent")
        private String rent;
        @SerializedName("state")
        private String state;

        public String getUrl(){
            if (ValidateUtils.isNotEmptyString(housingImg)){
                if (housingImg.contains(",")){
                    String[] strings = housingImg.split(",");
                    return strings[0];
                }
            }
            return "";
        }


        public String getUrlNum(){
            if (ValidateUtils.isNotEmptyString(housingImg)){
                if (housingImg.contains(",")){
                    String[] strings = housingImg.split(",");
                    return "+"+strings.length;
                }
            }
            return "0";
        }


        public int getHousingID() {
            return housingID;
        }

        public void setHousingID(int housingID) {
            this.housingID = housingID;
        }

        public String getHousingImg() {
            return housingImg;
        }

        public void setHousingImg(String housingImg) {
            this.housingImg = housingImg;
        }

        public String getQuarters() {
            return quarters;
        }

        public void setQuarters(String quarters) {
            this.quarters = quarters;
        }

        public String getRoomname() {
            return quarters+roomname;
        }

        public void setRoomname(String roomname) {
            this.roomname = roomname;
        }

        public String getHousingType() {
            return housingType;
        }

        public void setHousingType(String housingType) {
            this.housingType = housingType;
        }

        public String getTotalArea() {
            return roomname+totalArea+"㎡";
        }

        public void setTotalArea(String totalArea) {
            this.totalArea = totalArea;
        }

        public String getRent() {
            if (ValidateUtils.isEmptyString(rent)){
                return "面议";
            }else {
                return rent+"元/月";
            }
        }

        public void setRent(String rent) {
            this.rent = rent;
        }

        public String getState() {
            return state;
        }

        public void setState(String state) {
            this.state = state;
        }
    }
}
